import request from '@/utils/request'

// 查询出库管理列表
export function listOutbound(query) {
  return request({
    url: '/outbound/outbound/list',
    method: 'get',
    params: query
  })
}

// 查询出库管理详细
export function getOutbound(outboundId) {
  return request({
    url: '/outbound/outbound/' + outboundId,
    method: 'get'
  })
}

// 新增出库管理
export function addOutbound(data) {
  return request({
    url: '/outbound/outbound',
    method: 'post',
    data: data
  })
}

// 修改出库管理
export function updateOutbound(data) {
  return request({
    url: '/outbound/outbound',
    method: 'put',
    data: data
  })
}

// 删除出库管理
export function delOutbound(outboundId) {
  return request({
    url: '/outbound/outbound/' + outboundId,
    method: 'delete'
  })
}

// 查询部门
export function selectAllSysDept() {
  return request({
    url: '/outbound/outbound/selectAllSysDept',
    method: 'get'
  })
}

export function selectAllSysDeptByID(parent) {
  return request({
    url: '/outbound/outbound/selectAllSysDeptByID?deptid=' + parent,
    method: 'get'
  })
}
export function selectAllSysUserByParentId(parent) {
  return request({
    url: '/outbound/outbound/selectAllSysUserByParentId?deptid=' + parent,
    method: 'get'
  })

}

// 查询出库管理列表
export function listInRejected(query) {
  return request({
    url: '/outbound/outbound/listRejected',
    method: 'get',
    params: query
  })
}

// 查询销售出库列表
export function listOdSale(query) {
  return request({
    url: '/outbound/outbound/listOdSale',
    method: 'get',
    params: query
  })
}

// 查询进货退货详细
export function listRejectedDetails(query) {
  return request({
    url: '/outbound/outbound/listRejectedDetails',
    method: 'get',
    params: query
  })
}

// 查询销售出库详细
export function listOdSaleDetails(query) {
  return request({
    url: '/outbound/outbound/listOdSaleDetails',
    method: 'get',
    params: query
  })
}

// 获取编码
export function getCode(code) {
  return request({
    url: '/outbound/outbound/getcode?code=' + code,
    method: 'post'
  })
}

export function updateStatus(data) {
  return request({
    url: '/outbound/outbound/updateStatus',
    method: 'post',
    data: data
  })
}

//出库统计图
export function selectWhOutboundStatistics(dateBeginEnd) {
  return request({
    url: '/outbound/outbound/date',
    method: 'get',
    params: dateBeginEnd
  })
}


// 入库排名
export function selectWhOutboundRanking() {
  return request({
    url: '/outbound/outbound/ranking',
    method: 'get',
  })
}

// 概况
export function selectOverview(time) {
  return request({
    url: '/outbound/outbound/overview',
    method: 'get',
    params: time
  })
}


// 代表事项(待审核)
export function selectToExamine() {
  return request({
    url: '/outbound/outbound/toExamine',
    method: 'get',
  })
}

// 代表事项(待执行)
export function selectExecute() {
  return request({
    url: '/outbound/outbound/execute',
    method: 'get',
  })
}

